function graphics_ = gXmodality_graphics(varargin)

% right-left levers or up-down saccades?
% what is the dot motion axis?
if nargin==2 && ischar(varargin{1})

    % custom dot parameters?
    if ~isempty(varargin{2}) && isstruct(varargin{2})
        dot = varargin{2};
    else
        dot.x = 0;
        dot.y = 7;
        dot.diam = 8;
        dot.ang = 45;
        dot.dens = 25;
    end

    %dist = abs(dot.y) + dot.diam/2 + 1;
    dist = 10;

    switch varargin{1}
        case 'left-right'
            %configure for right-left lever pulls
            tg.x = {-dist, dist};
            tg.y = {0, 0};

        case 'down-up'
            % configure for up-down saccades
            tg.x = {0, 0};
            tg.y = {-dist, dist};
    end
else

    %default to vertical down-up as in eye movements
    tg.x = {0, 0};
    tg.y = {-10, 10};
    dot.x = 0;
    dot.y = 7;
    dot.diam = 8;
    dot.ang = 45;
    dot.dens = 25;
end

arg_dXdots = { ...
    'x',            dot.x, ...
    'y',            dot.y, ...
    'diameter',     dot.diam, ...
    'size',         3, ...
    'speed',        5, ...
    'coherence',    0, ...
    'direction',    0, ...
    'density',      dot.dens, ...
    'color',        [1,1,1,1]*255};

r = [1,0,0,1]*255;
g = [0,1,0,1]*128;
arg_dXtarget = { ...
    'x',            {0, 0, tg.x{:}}, ...
    'y',            {0, 0, tg.y{:}}, ...
    'penWidth',     1, ...
    'diameter',     {.4, .2, .8, .8}, ...
    'diameter2',	{6, 2, 8, 8}, ...
    'color',        {r, g, r, r}};

arg_dXfeedback = { ...
    'groupName',        'iti', ...
    'doEndTrial',       'block', ...
    'size',             22, ...
    'bold',             true, ...
    'x',                -16, ...
    'tasksColor',       [1 1 0]*255, ...
    'totalsColor',      [1 1 0]*255, ...
    'displaySecs',      6e2};

% 1-green line for speed
% 2-red line for accuracy
% 3-horizontal white line on top
% 4-horizontal white line on bottom
c = 64;
arg_dXline = { ...
    'x1',               {-2, 2, -3, -3}, ...
    'x2',               {-2, 2, 3, 3}, ...
    'y1',               {-5 -5 -5 5}, ...
    'y2',               {5 5 -5 5}, ...
    'color',            {[0 c 0], [c 0 0], [c c c], [c c c]}, ...
    'penWidth',         {10 10, 2, 2}, ...
    'visible',          false};

arg_dXtext = { ...
    'string',           {'fast', 'slow', 'accurate', 'inaccurate'}, ...
    'x',                {-3, -3, 1, 1}, ...
    'y',                {7, -6, 7, -6}, ...
    'size',             30, ...
    'color',            {[0 c 0], [0 c 0], [c 0 0], [c 0 0]}, ...
    'visible',          false};

% {'group', reuse, set now, set always}
static = {'root', true, true, false};
graphics_ = { ...
    'dXdots',       1,  static, arg_dXdots; ...
    'dXtarget',     4,  static, arg_dXtarget; ...
    'dXfeedback',	1,	static, arg_dXfeedback; ...
    'dXline',       4,  static, arg_dXline; ...
    'dXtext',       4,  static, arg_dXtext; ...
    };